<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>My Inbox</title>
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/1.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/2.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/3.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/4.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/5.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/6.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/7.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-layout.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-presentation.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/2FEu-VTjHxG.css" />
</head>
<body class="profile">
<!-- left column -->
<div id="lh-col"><br />
  <%@ include file="/WEB-INF/jsp/leftScreen.jsp" %>
</div>
<!-- end of left column -->
<!-- center column -->
<div id="c-col" align="center" >
  <div class="profile_top_wash">
    <div class="profile_color_bar vcard">
      <div id="pagelet_top_bar">
        <div id="c4cd706ade0e242e35533110">
          <div id="profile_top_bar" class="top_bar">
            <div class="profile_top_bar_container">
              <div class="tabs_wrapper clearfix">
                <ul id="profile_tabs" class="tabs">
                  <c:if test="${model.himself}">
                    <li view="info"><a class="tab_link profile_tab" href="/bob-web/service/homePage.htm">Home</a></li>
                    <li class="selected" view="inbox"><a class="tab_link profile_tab" href="/bob-web/service/inbox.htm">Inbox</a></li>
                    <li view="outbox"><a class="tab_link profile_tab" href="/bob-web/service/newMessage.htm">Compose Message</a></li>

                  </c:if>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div>
  

  
  

    <table>
      <tr height="50">

      </tr>
      <table width="90%" border="0" cellpadding="5">
          <tr>
              <td colspan="3">

                      <h2>Messages</h2>
            </td>
          </tr>
<c:choose>
<c:when test="${fn:length(model.userMessages)==0}">
    <tr>
        <td colspan="3">
                There are no messages
      </td>
    </tr>
</c:when>
<c:otherwise>
          <tr>
               <td>
              <font color="#999" size="+1">From</font>
              </td>

              <td>
              <font color="#999" size="+1">Title</font>
              </td>
              <td>
              <font color="#999" size="+1">Send Date</font>
              </td>
              <td>
              <font color="#999" size="+1">Status</font>
              </td>

          </tr>
		  <tr>
		  	<td colspan="4"> 
				<hr>
			</td> 
		  </tr>
          <c:forEach items="${model.userMessages}" var="userMessage">
          <tr>
              <td>
			  <a href="/bob-web/service/myWall.htm?wantedUserId=${userMessage.fromUserId}"> ${userMessage.fromUsername}</a>
				
              
              </td>
              <td>
                  <a href="messageDetail.htm?from_message_id=${userMessage.messageId}&toUserId=${userMessage.fromUserId}">
                ${userMessage.title}<c:if test="${fn:length(userMessage.subMessages)!= 0}">(${fn:length(userMessage.subMessages)})</c:if></a>
              </td>
              <td> <font color="#999" size="-2">
                  ${userMessage.createDate}
                  </font>
				  
              </td>
              <td>
                  <c:if test="${userMessage.fromUserId == model.user.userId}">
                      <font color="#999" size="-2">Sent</font>
                  </c:if>
                  <c:if test="${userMessage.fromUserId != model.user.userId}">
                      <font color="#999" size="-2">Received</font>
                  </c:if>
              </td>
          </tr>
		  <tr>
		  	<td colspan="4">
				<hr>
			</td> 
		  </tr>
             
	     </c:forEach>
    </c:otherwise>
    </c:choose>
      </table>
    </table>
  </div>
</div>
<!-- end of center column -->
<!-- right column -->
<div id="rh-col"> <a href="/bob-web/service/homePage.htm"><img border="0" src="/bob-web/Images/logo.png" alt="BookOfBoun" width="180" height="100" /></a>
  <%@ include file="/WEB-INF/jsp/rightScreen.jsp" %>
</div>
<!-- end of right column -->
</body>
</html>